import request from '@/utils/request'
import qs from 'qs'

// 请求地址前缀
const REQUEST_URL_PRE = "/manage/app";

export default {
    /**
     * 获取集合
     */
    list() {
        return request({
            url: REQUEST_URL_PRE + '/list',
            method: 'get'
        })
    },
    /**
     * 创建版本信息
     * @param {Object} appVersion -- 版本信息
     */
    add(appVersion) {
        let requestData = qs.stringify(appVersion);
        return request({
            url: REQUEST_URL_PRE + '/add',
            method: 'post',
            data: requestData
        })
    },
    /**
     * 修改版本信息
     * @param {Object} appVersion -- 版本信息
     */
    update(appVersion) {
        let requestData = qs.stringify(appVersion);
        return request({
            url: REQUEST_URL_PRE + '/update',
            method: 'post',
            data: requestData
        })
    },
    /**
     * 删除
     * @param {int} code -- 版本号
     */
    delete(code) {
        let data = { "account": account }
        let requestData = qs.stringify(data);
        return request({
            url: REQUEST_URL_PRE + '/deleteAccount',
            method: 'post',
            data: requestData
        })
    }
}
